package nqueens.parser;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class Parser {
	
	public Map<String,String> parse(String file) throws IOException {
		BufferedReader in = new BufferedReader(new FileReader(new File(file)));
		Map<String,String> info = new HashMap<String, String>();
		String line = in.readLine();
		while (line != null) {
			String[] splited = line.split("=");
			String key = splited[0].trim();
			String value = splited[1].trim();
			info.put(key,value);
			line = in.readLine();
		}
		return info;
	}

}
